import 'package:ivc/model/user_info_cache.dart';
import 'package:ivc/model/biz_info.dart';
import 'package:ivc/globals.dart' as globals;

abstract class Controller {
  Controller();
}

class SuggestionController implements Controller {
  final UserInfo userInfo;
  final BizInfo bizInfo;

  //取搜索关键词
  final Map<String, List<String>> keywords = {
    "zhusuji": ["注塑机 配件", "注塑机"],
    "gcjx": ["工程机械 配件", "工程机械", "工程机械 维修"],
  };
  //按场景KEY找相关的功能点
  final Map<String, Map<String, List<String>>> brain = {
    "zhusu": {
      "iiot": ["zhusuji_iiot", "zhusuji_zutai", "zhusuji_dianostic", "zhusuji_gongyiyouhua"],
      "service": ["zhusuji_gongyiyouhua", "zhusuji_zulin", "zhusuji_weixiu"],
      "parts": ["zhusuji"],
      "aux": [""]
    },
    "gcjx_zl": {
      "iiot": ["gcjx_iiot", "gcjx_gongkong", "gcjx_remote", "gcjx_gps", "gcjx_track", "gcjx_fengkong"],
      "service": ["gcjx_zulin", "gcjx_weixiu"],
      "parts": ["gcjx"],
      "aux": [""]
    }
  };

  SuggestionController(this.userInfo, this.bizInfo);

   List<String> getSuggestion(String biz) {
    return brain[globals.scenarioKey][biz];
  }
}

class IIoTSuggestions {
  static Map<String, Map<String, String>> _cardsContent = {
    "zhusuji_iiot": {
      "title": "注塑机工况呈现",
      "subtitle": "实时跟踪注塑机运行状况",
      "route": "/tipcard"
    },
    "zhusuji_zutai": {
      "title": "全厂注塑设备组态",
      "subtitle": "设备, 产况一目了然",
      "route": "/tipcard"
    },
    "zhusuji_dianostic": {
      "title": "注塑机故障远程诊断",
      "subtitle": "故障预警, 远程诊断, 减少次品",
      "route": "/tipcard"
    },
    "zhusuji_gongyiyouhua": {
      "title": "注塑工艺优化",
      "subtitle": "专家团队基于大数据给出工艺优化方案",
      "route": "/tipcard"
    },
    "gcjx_iiot": {"title": "机械设备在线",
      "subtitle": "离线/在线区别巨大",
      "route": "/tipcard"},
    "gcjx_gongkong": {"title": "运作状况一目了然",
      "subtitle": "比亲自操作设备了解到的还要多",
      "route": "/tipcard"},
    "gcjx_remote": {"title": "远程控制,解锁机",
      "subtitle": "让机械设备管理更容易",
      "route": "/tipcard"},
    "gcjx_gps": {"title": "想知道设备在哪",
      "subtitle": "直接在地图上显示设备的当前位置",
      "route": "/tipcard"},
    "gcjx_track": {"title": "运行轨迹也一目了然",
      "subtitle": "不仅如此,还能在地图上直接划定电子围栏",
      "route": "/tipcard"},
    "gcjx_fengkong": {"title": "还能方便投保",
      "subtitle": "树根合作保险机构给你更低的保费",
      "route": "/tipcard"},
  };
  //按功能点返回UI信息
  static Map<String, String> getCard(String cardkey){
    return _cardsContent[cardkey];
  }
}
